User Management
SQL for SingleStore:
List users
-- Show all users
SHOW USERS;
-- Show all custom users
SELECT * FROM information_schema.USERS WHERE TYPE = 'Native';
-- Show all coniglio DB users
SELECT * FROM information_schema.USERS WHERE USER LIKE '%coniglio%';
-- Show all search DB users
SELECT * FROM information_schema.USERS WHERE USER LIKE '%search%';
Create users and assign grants
-- Create regular user
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP ON coniglio.* TO 'coniglio'@'%' IDENTIFIED BY '<password>';
-- Create readonly user
GRANT SELECT ON search.* TO 'farfalla_readonly_operations'@'%' IDENTIFIED BY '<password>';
-- Grant SELECT privilege on all current databases and tables to a user
GRANT SELECT ON *.* TO 'global_readonly_grafana'@'%';
-- Show user's grants
SHOW GRANTS FOR 'farfalla_readonly_operations'@'%';
Drop/Delete users
-- Drop user
DROP user 'grafana_readonly'@'%';